import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = a > b ? a:b;
        int mid = 1;
        int i = 0;
        for (i = 2; i <= c; i++) {
            if(a % i == 0 && b % i == 0){
                mid = i;
            }
        }
        System.out.println("最大公约数是：" + mid);
    }
}
